package net.htjs.juc.chapter06.accountunsafe;

public class AccountUnsafe implements Account{

    private Integer balance;

    public AccountUnsafe(Integer balance) {
        this.balance = balance;
    }

    @Override
    public Integer getBalance() {
        return this.balance;
    }

    @Override
    public void withdraw(Integer amount) {
        this.balance -= amount;
    }

    public static void main(String[] args) {
        AccountUnsafe account = new AccountUnsafe(10000);
        Account.demo( account);
    }
}
